<?php 
class setting_tarif extends MX_Controller{
	public function index(){
		$adminMenu= $this->load->module('adminMenu/index');
		$setting =$this->load->Module('setting/admin');
		$this->template=$this->config->config['admin_template'];
		
		$tarif=self::get_tarif();
		$data=array(
				'update_footer'=>'Starview ',
				'admin_title'=>'Setting Tarif',
				'admin_menu'=>$adminMenu->generateAdminMenu(),
				'tarif'=>$tarif
		);
		
		
		$this->view(
				array('admin-header',
						'setting-tarif',
					'admin-footer'),
				$data); // Display the page
	}
	public function create(){
		$data = $this->input->post('tarif');
		$return=$this->model()->create($data);
		
		$this->load->helper('url');
		redirect('setting/tarif');
	}
	public function get_tarif(){
		$tarif=$this->model()->get_tarif();
		if(!$tarif)
			$tarif=array(
				'sub_photo'=>2,
				'top_7jours'=>6,'top_30jours'=>10,'top_2mois'=>15,
				'priority_1week'=>10,'priority_1month'=>15,'priority_2months'=>25,
				'urgent'=>10
		
			);
			
		return $tarif;
	}
}